#ifndef MEDIABRANCHMT_H
#define MEDIABRANCHMT_H
#include <QtWidgets>
#include <QMediaPlayer>
#include <QAudioOutput>
#include <QAudioFormat>
#include <QAudioDevice>
#include "solar/trunk/NinsipidView.h"
#include "solar/trunk/NPlayMask.h"
#include "solar/trunk/NSurveyor.h"
#include "solar/trunk/NScrollLabel.h"
#include "solar/trunk/NPushButton.h"
#include "solar/trunk/NWidget.h"
#include "solar/trunk/NAdjustedWin.h"
#define DF_PLAYRATE 10
#define DF_PLAYVOLUME 50
#define DF_PLAYSPEED 10

typedef enum {
    PLMD_LOOP,
    PLMD_DESC,
    PLMD_RANDOM,
    PLMD_ONCE,
    PLMD_ONCELOOP
} MEDIAPLMD;

typedef enum {
    VOLUME_UP,
    VOLUME_DOWM,
    VOLUME_NOTICE,
    VOLUME_MUTE,
    VOLUME_SMALL
} MEDIAVOLUME;

class MediaBranchBT{

public:
        MediaBranchBT();
        QMap<MEDIAPLMD, QString> MT_playMdStyle;
        QMap<MEDIAVOLUME, QString> MT_volumeStyle;

        QWidget *BT_temporary = new QWidget();
        // MediaIn Itialize
        QAudioFormat format;
        QMediaPlayer *MT_MediaPlayer = new QMediaPlayer();
        QAudioOutput *MT_audioPut = new QAudioOutput();
        Nwidget * BT_mainWidget = new Nwidget(BT_temporary);
        QGridLayout *BT_mainGrid = new QGridLayout(BT_mainWidget);
        QHBoxLayout *MD_playFuncHbox = new QHBoxLayout();
        QHBoxLayout *BT_combineHbox = new QHBoxLayout();
        QVBoxLayout *BT_durationVbox = new QVBoxLayout();
        QHBoxLayout *BT_durationHbox = new QHBoxLayout();
        QHBoxLayout *BT_additionHbox = new QHBoxLayout();

        QMap<QString, QColor> MapColorOption = {{MSEVKEY.WIN_NORMAL, QColor(151, 187, 212)},
                                                {MSEVKEY.WIN_ENTER, QColor(151, 187, 212)},
                                                {MSEVKEY.WIN_LEAVE, QColor(151, 187, 212)},
                                                {MSEVKEY.WIN_PRESS, QColor(135, 206, 250)},
                                                {MSEVKEY.WIN_RELEASE, QColor(151, 187, 212)}};

        NPlayMask *MT_mediastat = new NPlayMask(MaskType::PlayButton,
                                                8,
                                                3,
                                                QColor(223,215,219),
                                                QColor(231,225,228),
                                                QColor(236,131,124),
                                                QColor(49,49,49),
                                                BT_temporary);
        NPlayMask *MT_medianext = new NPlayMask(MaskType::NextButton,
                                                8,
                                                2,
                                                QColor(236,131,124),
                                                QColor(49,49,49),
                                                BT_temporary);
        NPlayMask *MT_medialast = new NPlayMask(MaskType::PriviousButton,
                                                8,
                                                2,
                                                QColor(236,131,124),
                                                QColor(49,49,49),
                                                BT_temporary);

        Nwidget *MT_tracksCover = new Nwidget(BT_temporary);
        NScrollLabel *MT_tracksEcho= new NScrollLabel(2, BT_temporary);
        NinsipidView *MT_mdplermode = new NinsipidView(BT_temporary);
        NinsipidView *MT_volumeView = new NinsipidView(BT_temporary);
        NinsipidView *MT_speedView = new NinsipidView(BT_temporary);
        NinsipidView *MT_duration = new NinsipidView("welcome", BT_temporary);
        NSlider *MT_tracksSlider = new NSlider(BT_temporary, 1, NT::ORIEN_HORIZONTAL);
        NinsipidView *MT_screen = new NinsipidView(BT_temporary);

protected:
    MOUSE_ATTRIBUTE MSEVKEY;
};
#endif











